<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the options for rrd graph export</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="rrdgraph.saveverbose.html">RRDGraph::saveVerbose</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.rrdupdater.html">RRDUpdater</a></div>
 <div class="up"><a href="class.rrdgraph.html">RRDGraph</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="rrdgraph.setoptions" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">RRDGraph::setOptions</h1>
  <p class="verinfo">(PECL rrd &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">RRDGraph::setOptions</span> &mdash; <span class="dc-title">Sets the options for rrd graph export</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-rrdgraph.setoptions-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>RRDGraph::setOptions</strong></span>
    ( <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>
   )</div>

  <p class="para rdfs-comment">

  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-rrdgraph.setoptions-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">options</code></em></dt>

    <dd>

     <p class="para">
      List of options for the image generation from the RRD database file. It can
      be list of strings or list of strings with keys for better readability. Read
      the rrd graph man pages for list of available options.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-rrdgraph.setoptions-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。  
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-rrdgraph.setoptions-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4406">
    <p><strong>Example #1 <span class="methodname"><strong>RRDGraph::setOptions()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$graphObj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--start"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"920804400"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--end"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">920808000</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--vertical-label"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"m/s"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"DEF:myspeed=</span><span style="color: #0000BB">$rrdFile</span><span style="color: #DD0000">:speed:AVERAGE"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"CDEF:realspeed=myspeed,1000,*"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"LINE2:realspeed#FF0000"<br /></span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>

   <div class="example" id="example-4407">
    <p><strong>Example #2 Set multiple color options</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$graphObj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--start"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"920804400"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--end"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">920808000</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--vertical-label"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"m/s"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color=BACK#00000000"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color=GRID#00000000"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color=MGRID#00000000"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"DEF:myspeed=</span><span style="color: #0000BB">$rrdFile</span><span style="color: #DD0000">:speed:AVERAGE"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"CDEF:realspeed=myspeed,1000,*"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"LINE2:realspeed#FF0000"<br /></span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>
     Don&#039;t use key value syntax for same rrd option. It looks more readable, but
     it doesn&#039;t work.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$graphObj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"BACK#00000000"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"GRID#00000000"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"MGRID#00000000"<br /></span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>
     In nature of php it&#039;s same as
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$graphObj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"--color"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"MGRID#00000000"<br /></span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="rrdgraph.saveverbose.html">RRDGraph::saveVerbose</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.rrdupdater.html">RRDUpdater</a></div>
 <div class="up"><a href="class.rrdgraph.html">RRDGraph</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
